import request from '@/axios'
import { QARType } from './types'

export const getSAPListApi = (params: any) => {
  return request.get<QARType[]>({ url: '/mock/check/sap', params })
}

export const getQARListApi = (params: any) => {
  return request.get<QARType[]>({ url: '/check/qar', params })
}

export const addQARApi = (method: string, data: any) => {
  return request.post({ url: `/check/qar/${method}`, data })
}

export const putQARApi = (data: any) => {
  return request.put({ url: `/check/qar/${data.id}`, data })
}

export const putQARStatusApi = (data: any) => {
  return request.put({ url: `/check/qar/${data.id}/status`, data })
}

export const putQARStampApi = (id: any, data) => {
  return request.put({ url: `/check/qar/${id}/stamp`, data })
}

export const getQARApi = (data: any) => {
  return request.get({ url: `/check/qar/${data.id}` })
}

export const deleteQARApi = (ids: string[] | number[]) => {
  return request.delete({ url: '/check/qar', data: ids })
}
